<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>介绍</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__common.css" />
    <style>
        body{
            background-color: #fff;
        }
        .aui-bar-nav .aui-iconfont {
            position: relative;
          font-family: "aui_iconfont";
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 49px;
            background-size: 22px 22px;
            font-size: 0.75rem;
        }
        body{
            background-color: #F5F5F5;
        }

        .advice {
            color: #333333;
            height: 5.675rem;
            padding-top: 0.855rem;
            padding-bottom: 0.855rem;
            font-size: 0.7rem;
            overflow-y: auto;
            word-break: break-all;
            word-wrap: break-word;
            background-color: #FFFFFF;
        }

        textarea::-webkit-input-placeholder {
            color: #B3B3B3;
        }
        .shuzi {
            font-size: 0.6rem;
            color: #999999;
            padding-bottom: 0.475rem;
            text-align: right;
            padding-right: 0.475rem;
            background-color: #FFFFFF
        }
    </style>
</head>

<body>
<div class="l_box"  id="loading2"><img src="__IMG__loading.gif" alt="" id="loading"></div>

<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title">介绍</div>
    <a class="aui-pull-right">
        <span class="aui-iconfont aui-icon-rightu" tapmode="active" onclick="save()" style="color:#333333;">保存</span>
    </a>
</header>
<textarea placeholder="请输入介绍..." class="advice" id="text1" maxlength="300"></textarea>
<div class="shuzi"><span id="num2">30</span></div>
<div class="toast-wrap">
    <span class="toast-msg"></span>
</div>
</body>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__common.js"></script>


<script type="text/javascript">
    window.onload = function() {

        var jieshao=getUrlParam();

        if ($.trim(jieshao)=='这里是自我介绍，一共只有30个字显示不下两行展示') {

        }else {
            $('#text1').val($.trim(jieshao));

        }

    };
    var user_id=55;

    function save() {
        var jieshao2=$('#text1').val();

        if ($.trim(jieshao2)=='') {
            toast('请输入内容后保存');
            return;
        }
        console.log('user_id='+user_id+'&content='+$('#text1').val());
        $.ajax({
            url:'{:url("My/editUser")}',
            data:'user_id='+user_id+'&content='+$('#text1').val(),
            type:'POST',
            dataType:'JSON',
            success: function(data){
                if (data.status=='200') {
                    toast('保存成功');
                   location.href = '{:url("My/person_center")}';

                }else {
                    toast(data.msg);
                }

            },
            error: function(xhr, type){
                toast('无网络或连接超时，请重试！');
                // 即使加载出错，也得重置

            }
        });
    }
</script>

</html>
